/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control_escolar;

import static control_escolar.inicio.constancia_inicio;
import static control_escolar.log.claves_sesion2;
import static control_escolar.log.expedientes;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;

/**
 *
 * @author francisco
 */
public class alumno extends javax.swing.JFrame {

    /**
     * Creates new form alumno
     */
    public alumno() {
        initComponents();
        this.sexo_alumno.addItem("Seleccione");
        this.sexo_alumno.addItem("Femenino");
        this.sexo_alumno.addItem("Masculino");
        setLocationRelativeTo(null);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    
         public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("nuevo-grupo-de-usuarios-icono-8585-32.png"));
        return retValue;
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        nombre_alumno = new javax.swing.JTextField();
        appaterno_alumno = new javax.swing.JTextField();
        apmaterno_alumno = new javax.swing.JTextField();
        fnac_alumno = new javax.swing.JTextField();
        curp_alumno = new javax.swing.JTextField();
        tipo_sangre_alumno = new javax.swing.JTextField();
        calle_alumno = new javax.swing.JTextField();
        colonia_alumno = new javax.swing.JTextField();
        numero_alumno = new javax.swing.JTextField();
        agregar_alumno = new javax.swing.JButton();
        regresar_alumno = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        telefono_alumno = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        NExp_Alumno = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        Escuela_Procedencia = new javax.swing.JTextField();
        Nombre_padre_tutor = new javax.swing.JTextField();
        sexo_alumno = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        alergias = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        correo_padre = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        tel_casa_padre = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        tel_oficina_padre = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        tel_cel_padre = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        CP = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        estado = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        municipio = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        clave_alumno = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Agregar Alumno");
        setIconImage(getIconImage());
        setResizable(false);

        jLabel1.setText("Nombre");

        jLabel2.setText("Apellido Paterno");

        jLabel3.setText("Apellido Materno");

        jLabel4.setText("Fecha de Nacimiento (DD-MM-YYYY)");

        jLabel5.setText("Curp");

        jLabel6.setText("Tipo de Sangre");

        jLabel7.setText("Calle");

        jLabel8.setText("Colonia");

        jLabel9.setText("Numero");

        nombre_alumno.setName("nombre_alumno"); // NOI18N
        nombre_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nombre_alumnoActionPerformed(evt);
            }
        });
        nombre_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                nombre_alumnoKeyTyped(evt);
            }
        });

        appaterno_alumno.setName("appaterno_alumno"); // NOI18N
        appaterno_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                appaterno_alumnoActionPerformed(evt);
            }
        });
        appaterno_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                appaterno_alumnoKeyTyped(evt);
            }
        });

        apmaterno_alumno.setName("apmaterno_alumno"); // NOI18N
        apmaterno_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                apmaterno_alumnoKeyTyped(evt);
            }
        });

        fnac_alumno.setName("fnac_alumno"); // NOI18N
        fnac_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fnac_alumnoActionPerformed(evt);
            }
        });
        fnac_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                fnac_alumnoKeyTyped(evt);
            }
        });

        curp_alumno.setName("curp_alumno"); // NOI18N
        curp_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                curp_alumnoActionPerformed(evt);
            }
        });

        tipo_sangre_alumno.setName("tipo_sangre_alumno"); // NOI18N
        tipo_sangre_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tipo_sangre_alumnoActionPerformed(evt);
            }
        });
        tipo_sangre_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                tipo_sangre_alumnoKeyTyped(evt);
            }
        });

        calle_alumno.setName("calle"); // NOI18N
        calle_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                calle_alumnoKeyTyped(evt);
            }
        });

        colonia_alumno.setName("colonia"); // NOI18N
        colonia_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                colonia_alumnoKeyTyped(evt);
            }
        });

        numero_alumno.setName("numero"); // NOI18N
        numero_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numero_alumnoActionPerformed(evt);
            }
        });
        numero_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                numero_alumnoKeyTyped(evt);
            }
        });

        agregar_alumno.setText("Agregar");
        agregar_alumno.setName("ingresar_alumno"); // NOI18N
        agregar_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                agregar_alumnoActionPerformed(evt);
            }
        });

        regresar_alumno.setText("Regresar");
        regresar_alumno.setName("regresar_alumno"); // NOI18N
        regresar_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                regresar_alumnoActionPerformed(evt);
            }
        });

        jLabel10.setText("Telefono");

        telefono_alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                telefono_alumnoKeyTyped(evt);
            }
        });

        jLabel11.setText("N°Expediente");

        NExp_Alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NExp_AlumnoActionPerformed(evt);
            }
        });
        NExp_Alumno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                NExp_AlumnoKeyTyped(evt);
            }
        });

        jLabel12.setText("Sexo");

        jLabel13.setText("Escuela de procedencia");

        jLabel14.setText(" Padre y/o Tutor");

        Escuela_Procedencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Escuela_ProcedenciaActionPerformed(evt);
            }
        });
        Escuela_Procedencia.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                Escuela_ProcedenciaKeyTyped(evt);
            }
        });

        Nombre_padre_tutor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Nombre_padre_tutorActionPerformed(evt);
            }
        });
        Nombre_padre_tutor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                Nombre_padre_tutorKeyTyped(evt);
            }
        });

        sexo_alumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sexo_alumnoActionPerformed(evt);
            }
        });

        jLabel15.setText("Alergias");

        alergias.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                alergiasKeyTyped(evt);
            }
        });

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel18.setText("Datos del Padre y/o Tutor");

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel19.setText("Datos del Alumno");

        jLabel16.setText("Correo Electronico");

        jLabel17.setText("Telefono de Casa");

        tel_casa_padre.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                tel_casa_padreKeyTyped(evt);
            }
        });

        jLabel20.setText("Telefono de Oficina");

        tel_oficina_padre.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                tel_oficina_padreKeyTyped(evt);
            }
        });

        jLabel21.setText("Telefono Celular");

        tel_cel_padre.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                tel_cel_padreKeyTyped(evt);
            }
        });

        jLabel22.setText("C.P.");

        CP.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                CPKeyTyped(evt);
            }
        });

        jLabel23.setText("Estado");

        estado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                estadoKeyTyped(evt);
            }
        });

        jLabel24.setText("Municipio");

        municipio.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                municipioKeyTyped(evt);
            }
        });

        jLabel25.setText("Contrasenia");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(16, 16, 16)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addComponent(jLabel17)
                            .addComponent(jLabel21))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(61, 61, 61)
                                .addComponent(Nombre_padre_tutor, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(tel_casa_padre, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(tel_cel_padre, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel20)
                            .addComponent(jLabel16))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(agregar_alumno)
                                .addGap(34, 34, 34)
                                .addComponent(regresar_alumno))
                            .addComponent(tel_oficina_padre, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addGap(18, 18, 18)
                                .addComponent(Escuela_Procedencia, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel7)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(calle_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(47, 47, 47)
                                        .addComponent(jLabel8)
                                        .addGap(18, 18, 18))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel23)
                                            .addComponent(jLabel9)
                                            .addComponent(jLabel10))
                                        .addGap(80, 80, 80)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(telefono_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(numero_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(estado, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(47, 47, 47)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel22)
                                            .addComponent(jLabel24))
                                        .addGap(10, 10, 10)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(colonia_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addGap(56, 56, 56)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(CP, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(municipio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addComponent(correo_padre, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel5))
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(jLabel12)
                                    .addGap(57, 57, 57)))
                            .addGap(62, 62, 62)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(sexo_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(186, 186, 186)
                                    .addComponent(alergias, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(apmaterno_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jLabel4))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(curp_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel15)
                                                .addComponent(jLabel6))))
                                    .addGap(18, 18, 18)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(fnac_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(tipo_sangre_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(nombre_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(NExp_Alumno, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel2)
                                        .addComponent(jLabel25))
                                    .addGap(18, 18, 18)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(appaterno_alumno, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
                                        .addComponent(clave_alumno)))))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(278, 278, 278)
                            .addComponent(jLabel18))))
                .addContainerGap(38, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addGap(287, 287, 287)
                .addComponent(jLabel19)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(NExp_Alumno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel11))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel25)
                        .addComponent(clave_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(nombre_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2)
                        .addComponent(appaterno_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(apmaterno_alumno, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
                    .addComponent(jLabel4)
                    .addComponent(fnac_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(curp_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(tipo_sangre_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(alergias)
                    .addComponent(jLabel15)
                    .addComponent(sexo_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(Escuela_Procedencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(calle_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(colonia_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(numero_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(CP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(estado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(municipio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(telefono_alumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addComponent(jLabel18)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(Nombre_padre_tutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16)
                    .addComponent(correo_padre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(tel_casa_padre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(tel_oficina_padre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(tel_cel_padre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(regresar_alumno)
                    .addComponent(agregar_alumno))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void agregar_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agregar_alumnoActionPerformed
        try {
            // TODO add your handling code here:
            agregarAlumno();
            JOptionPane.showMessageDialog(null, "Se Agrego Correctamente");
        } catch (IOException ex) {
            Logger.getLogger(alumno.class.getName()).log(Level.SEVERE, null, ex);
        }
      

    }//GEN-LAST:event_agregar_alumnoActionPerformed

    private void nombre_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nombre_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nombre_alumnoActionPerformed

    private void fnac_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fnac_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_fnac_alumnoActionPerformed

    private void curp_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_curp_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_curp_alumnoActionPerformed

    private void tipo_sangre_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tipo_sangre_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tipo_sangre_alumnoActionPerformed

    private void numero_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numero_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_numero_alumnoActionPerformed

    private void appaterno_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_appaterno_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_appaterno_alumnoActionPerformed

    private void regresar_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_regresar_alumnoActionPerformed
        // TODO add your handling code here:
       validando();
    }//GEN-LAST:event_regresar_alumnoActionPerformed

    private void Nombre_padre_tutorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Nombre_padre_tutorActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_Nombre_padre_tutorActionPerformed

    private void Escuela_ProcedenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Escuela_ProcedenciaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_Escuela_ProcedenciaActionPerformed

    private void nombre_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nombre_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
       
    }//GEN-LAST:event_nombre_alumnoKeyTyped

    private void appaterno_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_appaterno_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
        
    }//GEN-LAST:event_appaterno_alumnoKeyTyped

    private void apmaterno_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_apmaterno_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
        
    }//GEN-LAST:event_apmaterno_alumnoKeyTyped

    private void fnac_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_fnac_alumnoKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_fnac_alumnoKeyTyped

    private void tipo_sangre_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tipo_sangre_alumnoKeyTyped
        // TODO add your handling code here:
        //validacion en caso que teclee algo diferente a numeros

 char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_tipo_sangre_alumnoKeyTyped

    private void telefono_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_telefono_alumnoKeyTyped
        // TODO add your handling code here:
        
        //validacion en caso que teclee algo diferente a numeros

 char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_telefono_alumnoKeyTyped

    private void numero_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_numero_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_numero_alumnoKeyTyped

    private void NExp_AlumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_NExp_AlumnoKeyTyped
        // TODO add your handling code here:
        //validacion en caso que teclee algo diferente a numeros

 char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }



    

    }//GEN-LAST:event_NExp_AlumnoKeyTyped

    private void sexo_alumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sexo_alumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_sexo_alumnoActionPerformed

    private void estadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_estadoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
        
    }//GEN-LAST:event_estadoKeyTyped

    private void municipioKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_municipioKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_municipioKeyTyped

    private void CPKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_CPKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_CPKeyTyped

    private void alergiasKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_alergiasKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_alergiasKeyTyped

    private void Escuela_ProcedenciaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_Escuela_ProcedenciaKeyTyped
        // TODO add your handling code here:
        
    }//GEN-LAST:event_Escuela_ProcedenciaKeyTyped

    private void calle_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_calle_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_calle_alumnoKeyTyped

    private void colonia_alumnoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_colonia_alumnoKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_colonia_alumnoKeyTyped

    private void Nombre_padre_tutorKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_Nombre_padre_tutorKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isDigit(c)){
        evt.consume();
        }
    }//GEN-LAST:event_Nombre_padre_tutorKeyTyped

    private void tel_casa_padreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tel_casa_padreKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_tel_casa_padreKeyTyped

    private void tel_oficina_padreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tel_oficina_padreKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_tel_oficina_padreKeyTyped

    private void tel_cel_padreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tel_cel_padreKeyTyped
        // TODO add your handling code here:
        char c= evt.getKeyChar();

        if (Character.isLetter(c)){
        evt.consume();
        }
    }//GEN-LAST:event_tel_cel_padreKeyTyped

    private void NExp_AlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NExp_AlumnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_NExp_AlumnoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(alumno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(alumno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(alumno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(alumno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new alumno().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField CP;
    private javax.swing.JTextField Escuela_Procedencia;
    private javax.swing.JTextField NExp_Alumno;
    private javax.swing.JTextField Nombre_padre_tutor;
    private javax.swing.JButton agregar_alumno;
    private javax.swing.JTextField alergias;
    private javax.swing.JTextField apmaterno_alumno;
    private javax.swing.JTextField appaterno_alumno;
    private javax.swing.JTextField calle_alumno;
    private javax.swing.JTextField clave_alumno;
    private javax.swing.JTextField colonia_alumno;
    private javax.swing.JTextField correo_padre;
    private javax.swing.JTextField curp_alumno;
    private javax.swing.JTextField estado;
    private javax.swing.JTextField fnac_alumno;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JTextField municipio;
    private javax.swing.JTextField nombre_alumno;
    private javax.swing.JTextField numero_alumno;
    private javax.swing.JButton regresar_alumno;
    private javax.swing.JComboBox sexo_alumno;
    private javax.swing.JTextField tel_casa_padre;
    private javax.swing.JTextField tel_cel_padre;
    private javax.swing.JTextField tel_oficina_padre;
    private javax.swing.JTextField telefono_alumno;
    private javax.swing.JTextField tipo_sangre_alumno;
    // End of variables declaration//GEN-END:variables

    private void agregarAlumno()throws IOException {
        PrintWriter printwriter = new PrintWriter(new FileWriter("src/ArchivosTXT/Alumnos.txt", true));
            printwriter.print(NExp_Alumno.getText() + ";");
            printwriter.print(nombre_alumno.getText() + ";");
            printwriter.print(appaterno_alumno.getText() + ";");
            printwriter.print(apmaterno_alumno.getText() + ";");
            printwriter.print(fnac_alumno.getText() + ";");
            printwriter.print(curp_alumno.getText() + ";");
            printwriter.print(tipo_sangre_alumno.getText() + ";");
            printwriter.print(alergias.getText() + ";");
            printwriter.print(sexo_alumno.getSelectedItem() + ";");
            printwriter.print(Escuela_Procedencia.getText() + ";");            
            printwriter.print(calle_alumno.getText() + ";");
            printwriter.print(colonia_alumno.getText() + ";");
            printwriter.print(CP.getText() + ";");
            printwriter.print(estado.getText() + ";");
            printwriter.print(municipio.getText() + ";");
            printwriter.print(telefono_alumno.getText() + ";");
            printwriter.print(numero_alumno.getText() + ";");
            printwriter.print(Nombre_padre_tutor.getText() + ";");
            printwriter.print(correo_padre.getText() + ";");
            printwriter.print(tel_casa_padre.getText() + ";");
            printwriter.print(tel_oficina_padre.getText() + ";");
            printwriter.print(tel_cel_padre.getText() + ";");    
            printwriter.println(clave_alumno.getText() + ";");
            printwriter.flush();
            NExp_Alumno.setText("");
            nombre_alumno.setText("");
            appaterno_alumno.setText("");  
            apmaterno_alumno.setText("");  
            fnac_alumno.setText("");  
            curp_alumno.setText("");  
            tipo_sangre_alumno.setText(""); 
            alergias.setText("");
            sexo_alumno.setSelectedItem("Seleccione"); 
            Escuela_Procedencia.setText("");             
            calle_alumno.setText("");  
            colonia_alumno.setText(""); 
            CP.setText("");
            estado.setText("");
            municipio.setText("");
            telefono_alumno.setText(""); 
            numero_alumno.setText("");
            Nombre_padre_tutor.setText(""); 
            correo_padre.setText("");
            tel_casa_padre.setText("");
            tel_oficina_padre.setText("");
            tel_cel_padre.setText("");   
            clave_alumno.setText("");
    }

       public void validando() {
        String EXP = log.expedientes.getText();
        String pwd = log.claves_sesion2.getText();
        if (expedientes.getText().length() != 0 && claves_sesion2.getText().length() != 0) {
            try {

                BufferedReader alumnos = new BufferedReader(new FileReader("src/ArchivosTXT/Alumnos.txt"));
                String Materias;
                while ((Materias = alumnos.readLine()) != null) {

                    if (Materias.startsWith(EXP)) {
                        String[] Al = Materias.split(";");
                        if (Al[0].equals(EXP) && Al[22].equals(pwd)) {
                            
                            new inicio().setVisible(true);
                            this.setVisible(false);
                            inicio.constancia_inicio.setVisible(false);
                            inicio.reporte1.setVisible(false);
                            inicio.reporte2.setVisible(true);
                            inicio.reporte3.setVisible(false);
                            inicio.kardex_inicio.setVisible(true);
                            inicio.jMenu2.setVisible(false);
                        } else {
                            JOptionPane.showMessageDialog(null, "Datos Erroneos");
                        }
                    }
                }

                BufferedReader maestros = new BufferedReader(new FileReader("src/ArchivosTXT/Maestros.txt"));
                String Maestros;
                while ((Maestros = maestros.readLine()) != null) {
                    if (Maestros.startsWith(EXP)) {
                        String[] Ma = Maestros.split(";");
                        if (Ma[0].equals(EXP) && Ma[12].equals(pwd)) {
                            
                            new inicio().setVisible(true);
                            this.setVisible(false);
                            inicio.constancia_inicio.setVisible(false);
                            inicio.reporte1.setVisible(false);
                            inicio.reporte2.setVisible(true);
                            inicio.reporte3.setVisible(false);
                            inicio.kardex_inicio.setVisible(false);
                            inicio.jMenu2.setVisible(true);
                            inicio.alumno_inicio.setVisible(false);
                            inicio.maestro_inicio.setVisible(false);
                            inicio.materia_inicio.setVisible(false);
                            inicio.Calificaciones.setVisible(true);
                            inicio.jMenuItem6.setVisible(false);
                            //inicio.jMenuItem7.setVisible(false);

                        } else {
                            JOptionPane.showMessageDialog(null, "Datos Erroneos");
                        }
                    }
                }
                if (EXP.equals("Admin") && pwd.equals("Citrus")) {
                    
                    new inicio().setVisible(true);
                    this.setVisible(false);
                    constancia_inicio.setVisible(true);
                    inicio.reporte1.setVisible(true);
                    inicio.reporte2.setVisible(true);
                    inicio.reporte3.setVisible(true);
                    inicio.kardex_inicio.setVisible(true);
                    inicio.jMenu2.setVisible(true);
                    inicio.alumno_inicio.setVisible(true);
                    inicio.maestro_inicio.setVisible(true);
                    inicio.materia_inicio.setVisible(true);
                    inicio.Calificaciones.setVisible(true);
                    inicio.jMenuItem4.setVisible(true);
                    inicio.jMenuItem6.setVisible(true);
                    inicio.jMenuItem7.setVisible(true);
                } else {
                    JOptionPane.showMessageDialog(null, "Datos Erroneos");
                }
            } catch (IOException x) {
            }
        } else {
            JOptionPane.showMessageDialog(null, "Campos Requeridos");
        }
}
}
